@PACKAGE_INIT@

include(CMakeFindDependencyMacro)

set(_@MLN_QT_NAME@_supported_components @MLN_QT_SUPPORTED_COMPONENTS@)

foreach(_comp ${@MLN_QT_NAME@_FIND_COMPONENTS})
    if(NOT _comp IN_LIST _@MLN_QT_NAME@_supported_components)
        set(@MLN_QT_NAME@_FOUND False)
        set(@MLN_QT_NAME@_NOT_FOUND_MESSAGE "Unsupported component: ${_comp}")
    endif()

    if(_comp STREQUAL Core)
        find_dependency(Qt@QT_VERSION_MAJOR@ COMPONENTS Gui Network)
        if(NOT @MLN_QT_WITH_INTERNAL_SQLITE@)
            find_dependency(Qt@QT_VERSION_MAJOR@ COMPONENTS Sql)
        endif()

        include("${CMAKE_CURRENT_LIST_DIR}/@MLN_QT_NAME@${_comp}Targets.cmake")
    elseif(_comp STREQUAL Quick)
        find_dependency(QMapLibre COMPONENTS QuickPrivate)

        include("${CMAKE_CURRENT_LIST_DIR}/QMapLibreQuickMacros.cmake")
        include("${CMAKE_CURRENT_LIST_DIR}/QMapLibreQuickPluginQmlTargets.cmake")
    elseif(_comp STREQUAL QuickPrivate)
        find_dependency(@MLN_QT_NAME@ COMPONENTS Core)

        find_dependency(Qt@QT_VERSION_MAJOR@ COMPONENTS Quick)

        include("${CMAKE_CURRENT_LIST_DIR}/@MLN_QT_NAME@${_comp}Targets.cmake")
    elseif(_comp STREQUAL Location)
        find_dependency(@MLN_QT_NAME@ COMPONENTS Core QuickPrivate)

        find_dependency(Qt@QT_VERSION_MAJOR@ COMPONENTS Location)

        include("${CMAKE_CURRENT_LIST_DIR}/@MLN_QT_NAME@${_comp}Targets.cmake")
        include("${CMAKE_CURRENT_LIST_DIR}/@MLN_QT_NAME@${_comp}Macros.cmake")
        include("${CMAKE_CURRENT_LIST_DIR}/@MLN_QT_NAME@${_comp}PluginGeoServicesTargets.cmake")
        include("${CMAKE_CURRENT_LIST_DIR}/@MLN_QT_NAME@${_comp}PluginQmlTargets.cmake")
    elseif(_comp STREQUAL Widgets)
        find_dependency(@MLN_QT_NAME@ COMPONENTS Core)

        find_dependency(Qt@QT_VERSION_MAJOR@ COMPONENTS Widgets)

        include("${CMAKE_CURRENT_LIST_DIR}/@MLN_QT_NAME@${_comp}Targets.cmake")
    endif()
endforeach()
